package com.suxin.validator.annotation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author Tang
 * @classname MaxAnnotation
 * @description [  ]
 * @date 2023/1/7 14:53
 */
@Inherited
@Target(value = {ElementType.FIELD})
@Retention(RUNTIME)
@Constraint(validatedBy = {MaxConstraintValidator.class})
public @interface MaxAnnotation {

    /**
     * max
     * @return
     */
    int max() default 0;

    /**
     * isRequire
     * @return
     */
    boolean isRequire() default false;

    /**
     * 校验不通过时，返回的内容
     * @return
     */
    String message() default "";

    /**
     * groups
     * @return
     */
    Class<?>[] groups() default { };

    /**
     * payload
     * @return
     */
    Class<? extends Payload>[] payload() default { };

}
